// const fs = require("fs");
import axios from "axios";
import { Message, Loading } from "element-ui";
const data = [
  { key: "auditCompletionTime", name: "方案审核完成时间", type: "date" },
  { key: "acceptancePostpone", name: "方案验收延期天数", type: "input" },
  { key: "documentType", name: "单据类型", type: "option" },
  { key: "editActualSubmitTime", name: "编制提交完成时间", type: "date" },
  { key: "editAuditTime", name: "预计编制审核完成时间", type: "date" },
  { key: "editSubmissionTime", name: "预计编制提交完成时间", type: "date" },
  { key: "examinePostpone", name: "编制审核延期天数", type: "input" },
  { key: "finalReviewNode", name: "最终审核节点" },
  { key: "implementStartTime", name: "预计施工开始时间", type: "date" },
  {
    key: "orgId",
    name: "组织",
    type: "treeSclect",
    defaultProps: { children: "children", label: "orgName", id: "orgId" },
  },
  {
    key: "orgName",
    name: "组织",
    type: "treeSclect",
    defaultProps: { children: "children", label: "orgName", id: "orgName" },
  },
  // { key: "orgName", name: "组织名称" },
  { key: "organizationsPostpone", name: "编制提交延期天数" },
  { key: "planNode", name: "当前方案阶段", type: "option" },
  { key: "project", name: "所属项目", type: "treeSclect" },
  { key: "projectCategory", name: "工程类别", type: "option" },
  { key: "typeOfWork", name: "工程类别", type: "option" },
  { key: "projectName", name: "所属项目名称", type: "input" },
  { key: "reviewPostpone", name: "方案复核延期天数" },
  { key: "schemeCategory", name: "方案类别", type: "option" },
  { key: "schemeName", name: "方案名称", type: "input" },
  { key: "structureType", name: "结构类型", type: "input" },
  { key: "schemeCoding", name: "方案编码", type: "input" },
  { key: "fieldCode", name: "方案编码", type: "input" },
  { key: "verifystate", name: "单据状态", type: "option" },
  {
    key: "reportingUnit",
    name: "填报单位",
    type: "treeSclect",
    defaultProps: { children: "children", label: "orgName", id: "orgId" },
  },
  {
    key: "reportingDepartment",
    name: "申报部门",
    type: "treeSclect",
    defaultProps: { children: "children", label: "name", id: "orgid" },
  },
  { key: "constructionWorker", name: "技术/项目总工", type: "input" },
  { key: "recheckPosition", name: "复核部位", type: "input" },
  { key: "reviewContent", name: "复核内容", type: "input" },
  { key: "compilationSubmissionTime", name: "预计编制提交时间", type: "date" },
  {
    key: "lmplementationCompletionTime",
    name: "方案实施完成时间",
    type: "date",
  },
  {
    key: "expertargumentationselections",
    name: "专家论证选择",
    type: "option",
  },
  { key: "endTimeOfNeilunCertificate", name: "内论证结束时间", type: "date" },
  {
    key: "endTimeOfExternalDemonstration",
    name: "外论证结束时间",
    type: "date",
  },
  { key: "argumentationConclusion", name: "内部论证结论", type: "option" },
  { key: "argumentationExpert", name: "论证专家", type: "input" },
  { key: "demonstrationTime", name: "内部论证完成时间", type: "date" },
  { key: "expertOpinion", name: "内部专家意见", type: "input" },
  { key: "projectVname", name: "项目名称", type: "input" },
  { key: "orgId", name: "所属组织", type: "treeSclect" },
  { key: "argumentPlace", name: "内部论证地点", type: "input" },
  { key: "schemeCat", name: "方案类别", type: "option" },
  { key: "eisclosureTime", name: "方案交底时间", type: "date" },
  { key: "disclosureRemarks", name: "交底备注", type: "input" },
  { key: "reviewer", name: "复核人", type: "input" },
  { key: "estimatedCompletionTime", name: "预计完成时间", type: "date" },
  { key: "reviewTime", name: "项目复核时间", type: "date" },
  { key: "reviewConclusion", name: "项目复核结论", type: "input" },
  { key: "reNucleationTime", name: "再复核时间", type: "date" },
  { key: "reNuclearMan", name: "再复核人", type: "input" },
  { key: "reNuclearConclusion", name: "再复核结论", type: "input" },
  { key: "acceptor", name: "验收人", type: "input" },
  { key: "acceptanceTime", name: "方案验收时间", type: "date" },
  { key: "acceptanceRemarks", name: "验收备注", type: "input" },
  { key: "programmeAnnex", name: "方案附件", type: "file" },
  { key: "otherAccessories", name: "内部论证方案附件", type: "file" },
  { key: "argumentAfterAnnex", name: "内部论证后附件", type: "file" },
  { key: "relevantAttachments", name: "方案附件", type: "file" },
  { key: "technicalRevalidationAnnex", name: "技术再复核附件", type: "file" },
  { key: "technicalReview", name: "技术再复核", type: "option" },
  {
    key: "libraryTag",
    name: "智库标签",
    type: "treeSclect",
    defaultProps: {
      children: "children",
      label: "type_name",
      id: "id",
      dataType: "datas",
    },
  },
  { key: "part", name: "部位", type: "input" },
  { key: "description", name: "描述", type: "input" },
  { key: "checkConclusion", name: "验收结论", type: "option" },
  { key: "argumentGrade", name: "论证与服务层级", type: "option" },
  { key: "engineeringMajor", name: "工程专业", type: "input" },
  { key: "projectScale", name: "工程规模", type: "input" },
  { key: "serviceDemonstrationTime", name: "计划论证时间", type: "input" },
  { key: "serviceDemonstrationPlace", name: "论证地点", type: "input" },
  { key: "typeOfExpert", name: "需用专家类型", type: "input" },
  { key: "numberOfPeople", name: "人数", type: "input" },
  { key: "contacts", name: "联系人", type: "input" },
  { key: "phone", name: "联系电话", type: "input" },
  { key: "argumentationContent", name: "论证内容", type: "input" },
  {
    key: "typeOrNot",
    name: "是否属于模板、外架、深基坑和暗挖四类	",
    type: "option",
  },
  { key: "technicalReReview", name: "技术再复核对象", type: "option" },
  { key: "externalAccessories", name: "外部论证方案附件", type: "file" },
  { key: "expertOpinion", name: "内部专家意见", type: "input" },

  { key: "outerExpertOpinion", name: "外部专家意见", type: "input" },

  { key: "outerArgumentationConclusion", name: "外部论证结论", type: "option" },
  { key: "outerDemonstrationTime", name: "外部论证完成时间", type: "input" },
  { key: "typeOfArgument", name: "论证类型", type: "option" },
  { key: "argumentationExpertText", name: "内部论证专家", type: "input" },

  { name: "是否有区域公司", key: "regionalCompany", type: "option" },
  { name: "项目审核签字", key: "projectSign", type: "input" },
  { name: "项目审核日期", key: "projectDate", type: "input" },
  { name: "分公司审核意见", key: "branchOpinion", type: "input" },
  { name: "分公司审核签字", key: "branchSign", type: "input" },
  { name: "分公司审核日期", key: "branchDate", type: "input" },
  { name: "公司业务部门意见", key: "companyOpinion", type: "input" },
  { name: "公司业务部门签字", key: "companySign", type: "input" },
  { name: "公司业务部门日期", key: "companyDate", type: "input" },
  { name: "局业务部门审核意见", key: "bureauOpinion", type: "input" },
  { name: "局业务部门审核签字", key: "bureauSign", type: "input" },
  { name: "局业务部门审核日期", key: "bureauDate", type: "input" },
  {
    name: "局业务部门负责人审批意见",
    key: "bureauPrincipalOpinion",
    type: "input",
  },
  {
    name: "局业务部门负责人审核签名",
    key: "bureauPrincipalSign",
    type: "input",
  },
  {
    name: "局业务部门负责人审核日期",
    key: "bureauPrincipalDate",
    type: "input",
  },
  { name: "专家使用效果评价签字", key: "expertEvaluationSign", type: "input" },
  { name: "专家使用效果评价日期", key: "expertEvaluationDate", type: "input" },
  { name: "业务部门意见", key: "businessUnitOpinion", type: "input" },
  { name: "业务部门签字", key: "businessUnitSign", type: "input" },
  { name: "业务部门日期", key: "businessUnitDate", type: "input" },
  // { key: "typeOfArgument", name: "论证类型", type: "option" },

  // { key: "", name: "", type: "" },
];

const optionData = [
  {
    name2: "typeOfArgument",
    ownedLiteral: [
      {
        name: "投标",
        code: "1",
      },
      {
        name: "策划",
        code: "2",
      },
      {
        name: "施工组织设计",
        code: "3",
      },
      {
        name: "施工方案",
        code: "4",
      },
      {
        name: "其它",
        code: "5",
      },
    ],
  },

  {
    name2: "typeOrNot",
    ownedLiteral: [
      {
        name: "否",
        code: false,
      },
      {
        name: "是",
        code: true,
      },
    ],
  },
  {
    name2: "regionalCompany",
    ownedLiteral: [
      {
        name: "否",
        code: false,
      },
      {
        name: "是",
        code: true,
      },
    ],
  },
  {
    name2: "technicalReReview",
    ownedLiteral: [
      {
        name: "公司技术质量部",
        code: "1",
      },
      {
        name: "分公司技术质量部",
        code: "2",
      },
    ],
  },
  {
    name2: "argumentGrade",
    ownedLiteral: [
      {
        name: "局",
        code: "1",
      },
      {
        name: "公司",
        code: "2",
      },
    ],
  },
  {
    name2: "checkConclusion",
    ownedLiteral: [
      {
        name: "通过",
        code: "1",
      },
      {
        name: "修改后通过",
        code: "2",
      },
    ],
  },
  {
    name2: "technicalReview",
    ownedLiteral: [
      {
        name: "需要",
        code: "1",
      },
      {
        name: "不需要",
        code: "2",
      },
    ],
  },
  {
    name2: "BillNum",
    ownedLiteral: [
      {
        name: "schemePlan",
        code: "adbabd68",
      },
      {
        name: "schemeOrganization",
        code: "b0584d55",
      },
      {
        name: "insidesApply",
        code: "",
      },
      {
        name: "insides",
        code: "61229d15",
      },
      {
        name: "externals",
        code: "dfe7b27d",
      },
      {
        name: "schemeDisclosure",
        code: "4a6640af",
      },
      {
        name: "schemeToReviewApply",
        code: "b04217b7",
      },
      {
        name: "schemeToReview",
        code: "1967a7c6",
      },
      {
        name: "technicalReReviewApply",
        code: "",
      },
      {
        name: "技术再复核",
        code: "",
      },
      {
        name: "schemeAcceptanceApply",
        code: "05cf30a6",
      },
      {
        name: "acceptanceServiceApply",
        code: "",
      },
      {
        name: "schemeAcceptance",
        code: "37dd8cc4",
      },
    ],
  },
  {
    name2: "verifystate",
    ownedLiteral: [
      {
        name: "开立态",
        code: "0",
      },
      {
        name: "审核中",
        code: "1",
      },
      {
        name: "已审核",
        code: "2",
      },
      {
        name: "终止态",
        code: "3",
      },
      {
        name: "驳回到制单",
        code: "4",
      },
    ],
  },
  {
    id: "2852928985616640",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "scheme_category",
    displayName: "方案类别",
    description: "方案类别",
    descriptionResid: null,
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.scheme_category",
    ownedLiteral: [
      {
        id: "1705959472381820936",
        name: "A1",
        enumNameResId: null,
        typeid: "2852928985616640",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-04-18 14:37:01",
        enumIndex: 1,
      },
      {
        id: "1705959472381820937",
        name: "A2",
        enumNameResId: null,
        typeid: "2852928985616640",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-04-18 14:37:01",
        enumIndex: 2,
      },
      {
        id: "1705959472381820938",
        name: "B",
        enumNameResId: null,
        typeid: "2852928985616640",
        code: "3",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-04-18 14:37:01",
        enumIndex: 3,
      },
      {
        id: "1705959472381820939",
        name: "C",
        enumNameResId: null,
        typeid: "2852928985616640",
        code: "4",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-04-18 14:37:01",
        enumIndex: 4,
      },
      {
        id: "1705959472381820940",
        name: "D",
        enumNameResId: null,
        typeid: "2852928985616640",
        code: "5",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-04-18 14:37:01",
        enumIndex: 5,
      },
      {
        id: "1705959472381820941",
        name: "局级施工组织设计",
        enumNameResId: null,
        typeid: "2852928985616640",
        code: "6",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-04-18 14:37:01",
        enumIndex: 6,
      },
      {
        id: "1705959472381820942",
        name: "公司级施工组织设计",
        enumNameResId: null,
        typeid: "2852928985616640",
        code: "7",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-04-18 14:37:01",
        enumIndex: 7,
      },
    ],
    name2: "schemeCategory",
  },
  {
    id: "2900111835959552",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "early_warning_category",
    displayName: "方案类别-预警使用",
    description: "方案类别-预警使用",
    descriptionResid:
      "Z_ONLINE_YB_D21353D9-AA41-4A47-B4E2-FF535043A4BF_GT1672AT132_ENUM-EXT_KC1Z3BGV_1685806927501066240",
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.early_warning_category",
    mul_language: {
      zh_CN: {
        displayName: "方案类别-预警使用",
      },
    },
    ownedLiteral: [
      {
        id: "1685806927483240454",
        name: "全部",
        enumNameResId: null,
        typeid: "2900111835959552",
        code: "0",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:55:56",
        enumIndex: 1,
      },
      {
        id: "1685806927483240455",
        name: "A1",
        enumNameResId: null,
        typeid: "2900111835959552",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:55:56",
        enumIndex: 2,
      },
      {
        id: "1685806927483240456",
        name: "A2",
        enumNameResId: null,
        typeid: "2900111835959552",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:55:56",
        enumIndex: 3,
      },
      {
        id: "1685806927483240457",
        name: "B",
        enumNameResId: null,
        typeid: "2900111835959552",
        code: "3",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:55:56",
        enumIndex: 4,
      },
      {
        id: "1685806927483240458",
        name: "C",
        enumNameResId: null,
        typeid: "2900111835959552",
        code: "4",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:55:56",
        enumIndex: 5,
      },
      {
        id: "1685806927483240459",
        name: "D",
        enumNameResId: null,
        typeid: "2900111835959552",
        code: "5",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:55:56",
        enumIndex: 6,
      },
      {
        id: "1685806927483240460",
        name: "E",
        enumNameResId: null,
        typeid: "2900111835959552",
        code: "6",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:55:56",
        enumIndex: 7,
      },
      {
        id: "1685806927483240461",
        name: "F",
        enumNameResId: null,
        typeid: "2900111835959552",
        code: "7",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:55:56",
        enumIndex: 8,
      },
    ],
    name2: "earlyWarningCategory",
  },
  {
    id: "2892949292683520",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "doc_type_b",
    displayName: "单据类型-预警使用",
    description: "单据类型-预警使用",
    descriptionResid:
      "Z_ONLINE_YB_D21353D9-AA41-4A47-B4E2-FF535043A4BF_GT1672AT132_ENUM-EXT_KC1Z3BGV_1685806300435841024",
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.doc_type_b",
    mul_language: {
      zh_CN: {
        displayName: "单据类型-预警使用",
      },
    },
    ownedLiteral: [
      {
        id: "1685806300417490953",
        name: "全部",
        enumNameResId: null,
        typeid: "2892949292683520",
        code: "0",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:54:43",
        enumIndex: 1,
      },
      {
        id: "1685806300417490954",
        name: "施工方案",
        enumNameResId: null,
        typeid: "2892949292683520",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:54:43",
        enumIndex: 2,
      },
      {
        id: "1685806300417490955",
        name: "施工组织设计",
        enumNameResId: null,
        typeid: "2892949292683520",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:54:43",
        enumIndex: 3,
      },
    ],
    name2: "docTypeB",
  },
  {
    id: "2892946386080000",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "doc_type_a",
    displayName: "项目类别-预警使用",
    description: "项目类别-预警使用",
    descriptionResid:
      "Z_ONLINE_YB_D21353D9-AA41-4A47-B4E2-FF535043A4BF_GT1672AT132_ENUM-EXT_KC1Z3BGV_1685806223126429696",
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.doc_type_a",
    mul_language: {
      zh_CN: {
        displayName: "项目类别-预警使用",
      },
    },
    ownedLiteral: [
      {
        id: "1685806223108079619",
        name: "全部",
        enumNameResId: null,
        typeid: "2892946386080000",
        code: "0",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:54:34",
        enumIndex: 1,
      },
      {
        id: "1685806223108079620",
        name: "房建",
        enumNameResId: null,
        typeid: "2892946386080000",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:54:34",
        enumIndex: 2,
      },
      {
        id: "1685806223108079621",
        name: "基础设施",
        enumNameResId: null,
        typeid: "2892946386080000",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:54:34",
        enumIndex: 3,
      },
    ],
    name2: "docTypeA",
  },
  {
    id: "2852928984305920",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "document_type",
    displayName: "单据类型",
    description: "单据类型",
    descriptionResid: null,
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.document_type",
    ownedLiteral: [
      {
        id: "1685805115006517249",
        name: "施工方案",
        enumNameResId: null,
        typeid: "2852928984305920",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:52:25",
        enumIndex: 1,
      },
      {
        id: "1685805115006517250",
        name: "施工组织设计",
        enumNameResId: null,
        typeid: "2852928984305920",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-22 10:52:25",
        enumIndex: 2,
      },
    ],
    name2: "documentType",
  },
  {
    id: "1676296641528725512",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "sdfg",
    displayName: "下次见你上看到了",
    description: "下次见你上看到了",
    descriptionResid:
      "Z_ONLINE_YB_D21353D9-AA41-4A47-B4E2-FF535043A4BF_GT1672AT132_ENUM-EXT_KC1Z3BGV_1496127659716378624",
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.sdfg",
    mul_language: {
      zh_CN: {
        displayName: "下次见你上看到了",
      },
    },
    ownedLiteral: [
      {
        id: "1676296641528725513",
        name: "new1",
        enumNameResId: null,
        typeid: "1676296641528725512",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-09 15:23:33",
        enumIndex: 1,
      },
      {
        id: "1676296641528725514",
        name: "new2",
        enumNameResId: null,
        typeid: "1676296641528725512",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-03-09 15:23:33",
        enumIndex: 2,
      },
    ],
    name2: "sdfg",
  },
  {
    id: "1672597918772625411",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "plan_node",
    displayName: "方案阶段",
    description: "方案阶段",
    descriptionResid:
      "Z_ONLINE_YB_D21353D9-AA41-4A47-B4E2-FF535043A4BF_GT1672AT132_ENUM-EXT_KC1Z3BGV_1746781607539769344",
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.plan_node",
    mul_language: {
      zh_CN: {
        displayName: "方案阶段",
      },
    },
    ownedLiteral: [
      {
        id: "1746781607528235014",
        name: "方案计划",
        enumNameResId: null,
        typeid: "1672597918772625411",
        code: "方案计划",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-06-12 14:42:23",
        enumIndex: 1,
      },
      {
        id: "1746781607528235015",
        name: "方案编审(论证前)",
        enumNameResId: null,
        typeid: "1672597918772625411",
        code: "方案编审(论证前)",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-06-12 14:42:23",
        enumIndex: 2,
      },
      {
        id: "1746781607528235016",
        name: "内部论证服务申请",
        enumNameResId: null,
        typeid: "1672597918772625411",
        code: "内部论证服务申请",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-06-12 14:42:23",
        enumIndex: 3,
      },
      {
        id: "1746781607528235017",
        name: "方案编审(论证后)",
        enumNameResId: null,
        typeid: "1672597918772625411",
        code: "方案编审(论证后)",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-06-12 14:42:23",
        enumIndex: 4,
      },
      {
        id: "1746781607528235018",
        name: "方案交底",
        enumNameResId: null,
        typeid: "1672597918772625411",
        code: "方案交底",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-06-12 14:42:23",
        enumIndex: 5,
      },
      {
        id: "1746781607528235019",
        name: "技术复核",
        enumNameResId: null,
        typeid: "1672597918772625411",
        code: "技术复核",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-06-12 14:42:23",
        enumIndex: 6,
      },
      {
        id: "1746781607528235020",
        name: "方案验收",
        enumNameResId: null,
        typeid: "1672597918772625411",
        code: "方案验收",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2023-06-12 14:42:23",
        enumIndex: 7,
      },
    ],
    name2: "planNode",
  },
  {
    id: "2898356090769664",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "enable_status",
    displayName: "启用状态",
    description: "启用状态",
    descriptionResid:
      "Z_ONLINE_YB_D21353D9-AA41-4A47-B4E2-FF535043A4BF_GT1672AT132_ENUM-EXT_KC1Z3BGV_1519573310691606528",
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.enable_status",
    mul_language: {
      zh_CN: {
        displayName: "启用状态",
      },
    },
    ownedLiteral: [
      {
        id: "2898356090818816",
        name: "是",
        enumNameResId: null,
        typeid: "2898356090769664",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-10 11:20:16",
        enumIndex: 1,
      },
      {
        id: "2898356090867968",
        name: "否",
        enumNameResId: null,
        typeid: "2898356090769664",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-10 11:20:16",
        enumIndex: 2,
      },
    ],
    name2: "enableStatus",
  },
  {
    id: "2892955332006144",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "alert_type",
    displayName: "预警类型",
    description: "预警类型",
    descriptionResid:
      "Z_ONLINE_YB_D21353D9-AA41-4A47-B4E2-FF535043A4BF_GT1672AT132_ENUM-EXT_KC1Z3BGV_1516741759012438016",
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.alert_type",
    mul_language: {
      zh_CN: {
        displayName: "预警类型",
      },
    },
    ownedLiteral: [
      {
        id: "2892955332055296",
        name: "提前",
        enumNameResId: null,
        typeid: "2892955332006144",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:46:20",
        enumIndex: 1,
      },
      {
        id: "2892955332104448",
        name: "超期",
        enumNameResId: null,
        typeid: "2892955332006144",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:46:20",
        enumIndex: 2,
      },
    ],
    name2: "alertType",
  },
  {
    id: "2892954334482688",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "scheme_node",
    displayName: "方案节点",
    description: "方案节点",
    descriptionResid:
      "Z_ONLINE_YB_D21353D9-AA41-4A47-B4E2-FF535043A4BF_GT1672AT132_ENUM-EXT_KC1Z3BGV_1516741235026427904",
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.scheme_node",
    mul_language: {
      zh_CN: {
        displayName: "方案节点",
      },
    },
    ownedLiteral: [
      {
        id: "2892954334531840",
        name: "方案编制",
        enumNameResId: null,
        typeid: "2892954334482688",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:45:19",
        enumIndex: 1,
      },
      {
        id: "2892954334564608",
        name: "方案审批",
        enumNameResId: null,
        typeid: "2892954334482688",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:45:19",
        enumIndex: 2,
      },
      {
        id: "2892954334613760",
        name: "内部论证",
        enumNameResId: null,
        typeid: "2892954334482688",
        code: "3",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:45:19",
        enumIndex: 3,
      },
      {
        id: "2892954334646528",
        name: "外部论证",
        enumNameResId: null,
        typeid: "2892954334482688",
        code: "4",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:45:19",
        enumIndex: 4,
      },
      {
        id: "2892954334679296",
        name: "方案交底",
        enumNameResId: null,
        typeid: "2892954334482688",
        code: "5",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:45:19",
        enumIndex: 5,
      },
      {
        id: "2892954334712064",
        name: "方案复核",
        enumNameResId: null,
        typeid: "2892954334482688",
        code: "6",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:45:19",
        enumIndex: 6,
      },
      {
        id: "2892954334761216",
        name: "方案验收",
        enumNameResId: null,
        typeid: "2892954334482688",
        code: "7",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-08-06 15:45:19",
        enumIndex: 7,
      },
    ],
    name2: "schemeNode",
  },
  {
    id: "2852928971608320",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "argumentation_conclusion",
    displayName: "论证结论",
    description: "论证结论",
    descriptionResid: null,
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.argumentation_conclusion",
    ownedLiteral: [
      {
        id: "2881676009197824",
        name: "通过",
        enumNameResId: null,
        typeid: "2852928971608320",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-29 16:32:25",
        enumIndex: 1,
      },
      {
        id: "2881676009246976",
        name: "不通过",
        enumNameResId: null,
        typeid: "2852928971608320",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-29 16:32:25",
        enumIndex: 2,
      },
      {
        id: "2881676009279744",
        name: "修改后通过",
        enumNameResId: null,
        typeid: "2852928971608320",
        code: "3",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-29 16:32:25",
        enumIndex: 3,
      },
    ],
    name2: "argumentationConclusion",
  },
  {
    id: "2852928971608320",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "outer_argumentation_conclusion",
    displayName: "论证结论",
    description: "论证结论",
    descriptionResid: null,
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.outer_argumentation_conclusion",
    ownedLiteral: [
      {
        id: "2881676009197824",
        name: "通过",
        enumNameResId: null,
        typeid: "2852928971608320",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-29 16:32:25",
        enumIndex: 1,
      },
      {
        id: "2881676009246976",
        name: "不通过",
        enumNameResId: null,
        typeid: "2852928971608320",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-29 16:32:25",
        enumIndex: 2,
      },
      {
        id: "2881676009279744",
        name: "修改后通过",
        enumNameResId: null,
        typeid: "2852928971608320",
        code: "3",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-29 16:32:25",
        enumIndex: 3,
      },
    ],
    name2: "outerArgumentationConclusion",
  },
  {
    id: "2852928975098112",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "type_of_work",
    displayName: "工程类别",
    description: "工程类别",
    descriptionResid: null,
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.type_of_work",
    ownedLiteral: [
      {
        id: "2852928975147264",
        name: "房建",
        enumNameResId: null,
        typeid: "2852928975098112",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-09 09:09:25",
        enumIndex: 0,
      },
      {
        id: "2852928975147265",
        name: "基础设施",
        enumNameResId: null,
        typeid: "2852928975098112",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-09 09:09:25",
        enumIndex: 1,
      },
    ],
    name2: "typeOfWork",
  },
  {
    id: "2852928975098112",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "type_of_work",
    displayName: "工程类别",
    description: "工程类别",
    descriptionResid: null,
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.type_of_work",
    ownedLiteral: [
      {
        id: "2852928975147264",
        name: "房建",
        enumNameResId: null,
        typeid: "2852928975098112",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-09 09:09:25",
        enumIndex: 0,
      },
      {
        id: "2852928975147265",
        name: "基础设施",
        enumNameResId: null,
        typeid: "2852928975098112",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-09 09:09:25",
        enumIndex: 1,
      },
    ],
    name2: "projectCategory",
  },
  {
    id: "2852928975917312",
    modelType: "EntityAttrModel",
    metaType: "Enumeration",
    metadataLevel: "2",
    version: 0,
    name: "Expertargumentationselections",
    displayName: "专家论证选择A",
    description: "专家论证选择A",
    descriptionResid: null,
    expandable: "string",
    status: "1",
    tenantId: "kc1z3bgv",
    uri: "liudaowei.liudaowei.Expertargumentationselections",
    ownedLiteral: [
      {
        id: "2852928975982848",
        name: "仅内部论证",
        enumNameResId: null,
        typeid: "2852928975917312",
        code: "1",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-09 09:09:25",
        enumIndex: 0,
      },
      {
        id: "2852928975982849",
        name: "仅外部论证",
        enumNameResId: null,
        typeid: "2852928975917312",
        code: "2",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-09 09:09:25",
        enumIndex: 1,
      },
      {
        id: "2852928975982850",
        name: "内外部论证",
        enumNameResId: null,
        typeid: "2852928975917312",
        code: "3",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-09 09:09:25",
        enumIndex: 2,
      },
      {
        id: "2852928975982851",
        name: "无需论证",
        enumNameResId: null,
        typeid: "2852928975917312",
        code: "4",
        isDeleted: 0,
        icon: null,
        localId: null,
        tenantId: "kc1z3bgv",
        pubts: "2022-07-09 09:09:25",
        enumIndex: 3,
      },
    ],
    name2: "expertargumentationselections",
  },
];

const nodeData = {
  // 方案计划
  schemePlan: {
    apply: "approval",
    showData: [
      "schemeName",
      "schemeCategory",
      "projectCategory",
      "projectName",
      "documentType",
      "structureType",
      "editSubmissionTime",
      "editAuditTime",
      "editActualSubmitTime",
      "auditCompletionTime",
      "implementStartTime",
    ],
    operateData: [
      "schemeName",
      "schemeCategory",
      "projectCategory",
      "projectName",
      "documentType",
      "structureType",
      "editSubmissionTime",
      "editAuditTime",
      "editActualSubmitTime",
      "auditCompletionTime",
      "implementStartTime",
    ],
    requiredData: [],
    rules: {},
    fileData: [],
  },
  // 方案编制
  schemeOrganization: {
    apply: "approval",
    showData: [
      "schemeCoding",
      "schemeName",
      "schemeCategory",
      "projectName",
      "documentType",
      "typeOfWork",
      "structureType",
      "reportingUnit",
      "reportingDepartment",
      "constructionWorker",
      "recheckPosition",
      "reviewContent",
      "compilationSubmissionTime",
      "editAuditTime",
      "editActualSubmitTime",
      "auditCompletionTime",
      "lmplementationCompletionTime",
      "expertargumentationselections",
      "endTimeOfNeilunCertificate",
      "endTimeOfExternalDemonstration",
    ],
    operateData: [
      "reportingUnit",
      "reportingDepartment",
      "constructionWorker",
      "recheckPosition",
      "reviewContent",
      "technicalReview",
      "lmplementationCompletionTime",
      "expertargumentationselections",
      "endTimeOfNeilunCertificate",
      "endTimeOfExternalDemonstration",
      "libraryTag",
    ],
    requiredData: [
      "technicalReview",
      "expertargumentationselections",
      "endTimeOfNeilunCertificate",
      "endTimeOfExternalDemonstration",
      "programmeAnnex",
      "libraryTag",
    ],
    rules: {
      // 专家论证选择
      technicalReview: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
      expertargumentationselections: function (data1, data2, e, data3) {
        if (data3 && e) {
          console.log(e);
          data3.forEach((item) => {
            if (item.key == "endTimeOfNeilunCertificate") {
              if (e == 1 || e == 3) {
                item.disabled = false;
              } else {
                item.disabled = true;
              }
            }
            if (item.key == "endTimeOfExternalDemonstration") {
              if (e == 2 || e == 3) {
                item.disabled = false;
              } else {
                item.disabled = true;
              }
            }
            return item;
          });
        }
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
      endTimeOfNeilunCertificate: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
      endTimeOfExternalDemonstration: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
      programmeAnnex: function (data) {
        // data.filesData = null;
        // console.log(data);
        // debugger;
        if (data.filesData != "" && data.filesData) {
          return true;
        } else {
          Message({
            message: data.name + "不能为空",
            type: "warning",
          });
          return false;
        }
      },
      libraryTag: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
    },
    fileData: ["programmeAnnex"],
    specialRules: function (nodeItemData) {
      let disabled1 = false;
      let disabled2 = false;
      for (let e in nodeItemData) {
        if (nodeItemData[e].key == "expertargumentationselections") {
          switch (nodeItemData[e].value) {
            case "1":
              disabled2 = true;
              break;
            case "2":
              disabled1 = true;
              break;
            case "3":
              break;
            case "4":
              disabled1 = true;
              disabled2 = true;
              break;
            default:
              break;
          }
        }
      }
      nodeItemData.forEach((item) => {
        if (item.key == "endTimeOfNeilunCertificate") {
          item.disabled = disabled1;
        }
        if (item.key == "endTimeOfExternalDemonstration") {
          item.disabled = disabled2;
        }
        return item;
      });
    },
  },
  // 内部论证服务申请
  insidesApply: {
    apply: "pushDown",
    showData: [],
    operateData: [
      "argumentGrade",
      "engineeringMajor",
      "projectScale",
      "serviceDemonstrationTime",
      "serviceDemonstrationPlace",
      "typeOfExpert",
      "numberOfPeople",
      "contacts",
      "phone",
      "argumentationContent",
    ],
    requiredData: [],
    rules: {
      argumentGrade: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
      engineeringMajor: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
    },
    fileData: ["programmeAnnex"],
  },
  // 方案内部论证
  insides: {
    apply: "approval",
    showData: [
      "schemeName",
      "schemeCat",
      "documentType",
      "typeOfWork",
      "projectName",
      "orgId",
      "orgName",
      "argumentationExpert",
      "demonstrationTime",
      "argumentationConclusion",
      "argumentPlace",
      "expertOpinion",
    ],
    operateData: [
      "typeOfArgument",
      "argumentGrade",
      "serviceDemonstrationTime",
      "argumentationExpertText",

      "serviceDemonstrationPlace",
      "numberOfPeople",
      "contacts",
      "phone",
      "typeOfExpert",
      "expertargumentationselections",
      "argumentationConclusion",
      "expertOpinion",
      "engineeringMajor",
      "projectScale",
      "regionalCompany",
      "argumentationContent",
      "projectSign",
      "projectDate",
      "branchOpinion",
      "branchSign",
      "branchDate",
      "companyOpinion",
      "companySign",
      "companyDate",
      "bureauOpinion",
      "bureauSign",
      "bureauDate",
      "bureauPrincipalOpinion",
      "bureauPrincipalSign",
      "bureauPrincipalDate",
      "expertEvaluationSign",
      "expertEvaluationDate",
      "businessUnitOpinion",
      "businessUnitSign",
      "businessUnitDate",
    ],
    requiredData: [],
    rules: {
      argumentAfterAnnex: function (data) {
        // data.filesData = null;
        // console.log(data);
        // debugger;
        if (data.filesData != "" && data.filesData) {
          return true;
        } else {
          Message({
            message: data.name + "不能为空",
            type: "warning",
          });
          return false;
        }
      },
      demonstrationTime: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
    },
    fileData: ["programmeAnnex", "otherAccessories"],
  },
  // 方案外部论证
  externals: {
    apply: "approval",
    showData: [
      "schemeCoding",
      "schemeName",
      "schemeCategory",
      "orgId",
      "orgName",
      "projectName",
      "typeOfWork",
      "documentType",
      "argumentationConclusion",
      "argumentationExpert",
      "demonstrationTime",
      "expertOpinion",
    ],
    operateData: [
      "expertOpinion",
      "argumentationConclusion",
      "demonstrationTime",
      "argumentPlace",
      // "argumentationConclusion",
      "outerExpertOpinion",
      "outerArgumentationConclusion",
      "outerDemonstrationTime",
      //
      // "expertOpinion",
    ],
    requiredData: [],
    rules: {
      otherAccessories: function (data) {
        // data.filesData = null;
        // console.log(data);
        // debugger;
        if (data.filesData != "" && data.filesData) {
          return true;
        } else {
          Message({
            message: data.name + "不能为空",
            type: "warning",
          });
          return false;
        }
      },
      demonstrationTime: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
    },
    fileData: ["programmeAnnex", "otherAccessories", "externalAccessories"],
  },
  // name: "方案交底",
  schemeDisclosure: {
    apply: "approval",
    showData: [
      "schemeCoding",
      "schemeName",
      "schemeCategory",
      "orgId",
      "orgName",
      "projectName",
      "typeOfWork",
      "eisclosureTime",
      "disclosureRemarks",
    ],
    operateData: ["eisclosureTime", "disclosureRemarks"],
    requiredData: [],
    rules: {},
    fileData: ["relevantAttachments"],
  },
  // name: "方案复核申请",
  schemeToReviewApply: {
    apply: "pushDown",
    showData: [
      "fieldCode",
      "schemeName",
      "schemeCategory",
      "orgId",
      "orgName",
      "projectName",
      "typeOfWork",
      "reviewer",
      "estimatedCompletionTime",
    ],
    operateData: ["reviewer", "estimatedCompletionTime"],
    requiredData: ["estimatedCompletionTime"],
    rules: {
      estimatedCompletionTime: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
    },
    pushDownData: [
      "field_code",
      "scheme_name",
      "scheme_category",
      "org_id",
      "org_id_name",
      "tb_plans_id",
      "project",
      "project_vname",
      "type_of_work",
      "document_type",
      "estimated_completion_time",
      "tb_disclosures_id",
      "source_id",
      "programme_annex",
    ],
  },
  // name: "方案复核",
  schemeToReview: {
    apply: "approval",
    showData: [
      "schemeCoding",
      "schemeName",
      "schemeCategory",
      "orgId",
      "orgName",
      "projectName",
      "typeOfWork",
      "reviewer",
      "reviewTime",
      "reviewConclusion",
      "reNucleationTime",
      "reNuclearMan",
      "reNuclearConclusion",
    ],
    operateData: [
      "reviewTime",
      "reviewConclusion",
      // "reNucleationTime",
      // "reNuclearMan",
      // "reNuclearConclusion",
    ],
    requiredData: ["reviewTime"],
    rules: {
      reviewTime: function (data1, data2) {
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
    },
    fileData: [
      "relevantAttachments",
      //  "technicalRevalidationAnnex"
    ],
  },
  // name: "技术再复核服务申请",
  technicalReReviewApply: {
    apply: "pushDown",
    showData: [],
    operateData: ["typeOrNot", "technicalReReview"],
    requiredData: [],
    rules: {},
  },
  // name: "技术再复核",
  123: {
    apply: "approval",
    showData: [],
    operateData: [],
    requiredData: [],
    rules: {},
  },
  // name: "方案验收申请",
  schemeAcceptanceApply: {
    apply: "pushDown",
    showData: [
      "schemeCoding",
      "schemeName",
      "schemeCategory",
      "orgId",
      "orgName",
      "projectName",
      "typeOfWork",
      "acceptor",
      "estimatedCompletionTime",
    ],
    operateData: ["part", "description", "acceptor", "estimatedCompletionTime"],
    requiredData: ["estimatedCompletionTime"],
    rules: {
      estimatedCompletionTime: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
    },
    pushDownData: [
      "scheme_coding",
      "scheme_name",
      "org_id",
      "org_id_name",
      "scheme_category",
      "tb_plans_id",
      "project",
      "project_vname",
      "type_of_work",
      "document_type",
      "acceptor",
      "estimated_completion_time",
      "tb_to_review_id",
      "source_id",
      "programme_annex",
    ],
  },
  // name: "验收服务申请",
  acceptanceServiceApply: {
    apply: "pushDown",
    showData: [],
    operateData: [],
    requiredData: [],
    rules: {},
  },
  // name: "方案验收",
  schemeAcceptance: {
    apply: "approval",
    showData: [
      "schemeCoding",
      "schemeName",
      "schemeCategory",
      "orgId",
      "orgName",
      "projectName",
      "typeOfWork",
      "acceptanceTime",
      "acceptanceRemarks",
    ],
    operateData: ["acceptanceTime", "checkConclusion", "acceptanceRemarks"],
    requiredData: ["acceptanceTime"],
    rules: {
      acceptanceTime: function (data1, data2) {
        // debugger
        let YN = YNkong(data1.value, data1.name);
        if (!YN) {
          return false;
        } else {
          return true;
        }
      },
    },
    fileData: ["relevantAttachments"],
  },
  detection: {
    apply: "pushDown",
    showData: [],
    operateData: [],
    requiredData: [],
    rules: {},
  },
};
const TreeData = {
  libraryTag: async function () {
    let data = await getlibraryTag.call();
    // console.log(data);
    return data;
  },
  reportingUnit: async function () {
    let data = await getTissue.call();
    // console.log(data);
    return data;
  },
  reportingDepartment: async function () {
    let data = await getdepartment.call();
    return data;
  },
  orgId: async function () {
    let data = await getTissue.call();
    // console.log(data);
    return data;
  },
  orgName: async function () {
    let data = await getTissue.call();
    // console.log(data);
    return data;
  },
  project: async function () {
    let data = await getProjectId.call();
    // console.log(data);
    return data;
  },
};
function YNkong(value, name) {
  // debugger
  let YN =
    value !== null &&
    value !== undefined &&
    value !== "" &&
    !(Array.isArray(value) && value.length === 0);
  if (!YN) {
    Message({
      message: name + "不能为空",
      type: "warning",
    });
  }
  return YN;
}
async function getlibraryTag() {
  try {
    let response = await axios({
      // 请求方式
      method: "GET",
      // 请求的地址
      url: "https://wei.cscec5b.com.cn:9067/gateway-gray/sixinplace-server/api/v1/SchemeMonitoring/getLibraryTag",
      // URL 中的查询参数
    });
    console.log("获取智库标签", response.data);
    if (response.data.code == 0) {
      return response.data.data;
    } else {
      throw new Error("请求失败");
    }
  } catch (error) {
    console.error(error);
  }
}
async function getProjectId() {
  try {
    let userInfo = JSON.parse(localStorage.getItem("userInfo"));
    let response = await axios({
      // 请求方式
      method: "GET",
      // 请求的地址
      url:
        "https://wei.cscec5b.com.cn:9067/gateway/openapi-server/sys/authority/queryProjectByUserId?userId=" +
        userInfo.userId,
      // URL 中的查询参数
    });
    console.log(response.data);
    if (response.data.code == 0) {
      return response.data.data;
    } else {
      throw new Error("请求失败");
    }
  } catch (error) {
    console.log(error);
  }
}

async function getdepartment() {
  try {
    let response = await axios({
      // 请求方式
      method: "GET",
      // 请求的地址
      url: "https://wei.cscec5b.com.cn:9067/gateway-gray/sixinplace-server/api/v1/SchemeMonitoring/getDeptRefData",
      // URL 中的查询参数
    });
    console.log("获取部门", response.data);
    if (response.data.code == 0) {
      return response.data.data;
    } else {
      throw new Error("请求失败");
    }
  } catch (error) {
    console.error(error);
  }
}
async function getTissue() {
  try {
    let response = await axios({
      // 请求方式
      method: "GET",
      // 请求的地址
      url: "https://wei.cscec5b.com.cn:9067/gateway/task-admin/api/v1/common/data/org/treeByUser",
      // URL 中的查询参数
    });
    // console.log("获取组织", response.data);
    if (response.data.code == 0) {
      return response.data.data;
    } else {
      throw new Error("请求失败");
    }
  } catch (error) {
    console.error(error);
  }
}
// function snakeToCamel(s) {
//   return s.replace(/(_\w)/g, function (m) {
//     return m[1].toUpperCase();
//   });
// }

export default {
  snakeToCamel(s) {
    return s.replace(/(_\w)/g, function (m) {
      return m[1].toUpperCase();
    });
  },
  getTreeData: async (key) => {
    try {
      // debugger
      if (TreeData[key]) {
        let data = await TreeData[key]();
        // console.log(data)
        return data;
      } else {
        return [];
      }
    } catch (error) {
      console.log(error);
    }
  },
  // 获取节点数据显示数据
  getnodeData(key) {
    if (nodeData[key]) {
      return nodeData[key];
    } else {
      return null;
    }
  },
  // 获取枚举
  getOption(key) {
    try {
      const item = optionData.find((obj) => {
        return obj.name2 === key;
      });
      let data = item.ownedLiteral.map((items) => {
        let option = {
          value: items.code,
          label: items.name,
        };
        return option;
      });
      return data;
    } catch (error) {
      return null;
    }
  },
  getName(key, type = "text") {
    const result = data.find((obj) => {
      return obj.key === key;
    });
    if (type == "text") {
      return result.name;
    } else if (type == "item") {
      return result;
    }
  },
  getKey(name, type = "text") {
    const result = data.find((obj) => {
      return obj.name === name;
    });
    if (type == "text") {
      return result.key;
    } else if (type == "item") {
      return result;
    }
  },
};

// function snakeToCamel(s) {
//   return s.replace(/(_\w)/g, function (m) {
//     return m[1].toUpperCase();
//   });
// }
// function getDatas() {
//   let data2 = [];
//   for (const e in optionData) {
//     optionData[e].name2 = snakeToCamel(optionData[e].name);
//     data2.push(optionData[e]);
//   }
//   fs.writeFile("data.json", JSON.stringify(data2), (err) => {
//     if (err) throw err;
//     console.log("Data written to file");
//   });
// }
// getDatas();
